-
Notifications
You must be signed in to change notification settings - Fork 509
Update Anthropic instrumentation #918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
|
Dude this is very well done! Just a couple questions and minor notes. |
…e unused EventHandler class. Update original_handler type to Any for flexibility.
…instrumentation. Introduce helper functions to handle various content types and extract attributes for telemetry. Update `get_message_request_attributes` to streamline message handling and support complex content structures.
… to replace old attribute keys with new `MessageAttributes` constants for correct indexing.
tcdent
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
bboynton97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd really love to see unit testing on this because it seems pretty low lift. Other than that, GREAT job. this is very well extended, readable and does the job!! nice work @Dwij1704!
|
Tested against |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A common error when running the notebooks is this -
(DEBUG) 🖇 AgentOps: [agentops.instrumentation.anthropic] Error creating simplified prompts: type object 'MessageAttributes' has no attribute 'LLM_PROMPTS'
(DEBUG) 🖇 AgentOps: [agentops.instrumentation.anthropic] Unrecognized return type: <class 'anthropic.Stream'>…uest_attributes`
|
dot-agi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything ok.
Good job @Dwij1704 🚀
|
dwij you the guy omg |

📥 Pull Request
📘 Description
Closes #912
Nuked previous implementation
messages.create(modern API) andcompletions.create(legacy API)Testing
Tested the instrumentation with the following script (Covers all scenarios)